import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

export default new Vuex.Store({
    state:{
        username:""
    },
    mutations:{
        setUsername:(state,uname) => {
            state.username = uname
            localStorage.setItem("username",uname)
        }

    },
    actions:{},
    getters:{
        // username(){
        //     return localStorage.getItem("username")
        // }
        username: state => localStorage.getItem("username")
    }
})